
import { MongooseFactory } from "../kalend";
import { Schema } from "mongoose";

/** 奖励赠送记录表 */
const schema = MongooseFactory.Schema({
    // 商户账户余额
    balance: {
        type: Number,
        default: 0
    },
    // 交易金额
    money: {
        type: Number,
        default: 0
    },
    // 消费前酒币数量
    originbalance: {
        type: Number,
        default: 0
    },
    // 奖励用户id
    platform_user: {
        type: Schema.Types.ObjectId,
        ref: "platform_user"
    },
    // 商户
    merchantid: {
        type: Schema.Types.ObjectId,
        ref: "merchant"
    },
    // 被邀请用户
    customerid: {
        type: Schema.Types.ObjectId,
        ref: "customer_account"
    },
    // 邀请用户
    inviterid: {
        type: Schema.Types.ObjectId,
        ref: "customer_account"
    },
    // 订单id
    customerorderid: {
        type: Schema.Types.ObjectId,
        ref: "customer_order"
    }
});



export const userwinhistoryModel = MongooseFactory.Model("userwinhistory", schema);